import xhr from '@http/http'
// 获取查询规则列表
export const _getRating = data =>
  xhr(`./api/rating/type/${data}`, {
    method: 'POST'
  })

// 修改规则
export const _changeRating = body =>
  xhr(`./api/rating/modify`, {
    method: 'POST',
    body
  })
// 根据登陆用户查询学院列表
export const _getListCollegeByUser = () =>
  xhr(`./api/common/listCollegeByUser`, {
    method: 'GET'
  })
// 学院分管-根据学院id查询管辖楼栋
export const _getlistBuildingByCollegeId = collegeId =>
  xhr(`./api/systemManagement/listBuildingByCollegeId/${collegeId}`, {
    method: 'GET'
  })
// 根据楼栋id查询下面的楼层
export const _getlistFloorByBuildingId = id =>
  xhr(`./api/common/listFloorByBuildingId/${id}`, {
    method: 'GET'
  })
// 学院分管-根据学院id和楼层id查询房间列表
export const _getlistRoomByCollegeAndFloor = (floorId, collegeId) =>
  xhr(
    `./api/systemManagement/listRoomByCollegeAndFloor/${floorId}/${collegeId}`,
    {
      method: 'GET'
    }
  )
// 学院分管-调整学院分管的寝室--添加
export const _addCollegeRoom = body =>
  xhr(`./api/systemManagement/addCollegeRoom`, {
    method: 'POST',
    body
  })
// 学院分管-调整学院分管的寝室--移除
export const _removeCollegeRoom = body =>
  xhr(`./api/systemManagement/removeCollegeRoom`, {
    method: 'POST',
    body
  })
// 学院分管-为学院新增楼栋
export const _addBuildingToCollege = body =>
  xhr(`./api/systemManagement/addBuildingToCollege`, {
    method: 'POST',
    body
  })
// 学院分管-删除指定的楼栋配置
export const _deleteCollegeBuildingById = id =>
  xhr(`./api/systemManagement/deleteCollegeBuildingById/${id}`, {
    method: 'DELETE'
  })
// 校区分管-查询所有学校用户的sn
export const _getlistSchoolUser = () =>
  xhr(`./api/systemManagement/listSchoolUser`, {
    method: 'GET'
  })
// 校区分管-根据用户sn查询管理的校区
export const _getlistSchoolAreaBySn = sn =>
  xhr(`./api/systemManagement/listSchoolAreaBySn/${sn}`, {
    method: 'GET'
  })
// 校区分管-修改分管校区配置
export const _addOrUpdateSchoolAreaToSn = body =>
  xhr(`./api/systemManagement/addOrUpdateSchoolAreaToSn`, {
    method: 'POST',
    body
  })
// 获取流程详情
export const _getSetting = id =>
  xhr(`./api/systemManagement/flow/${id}/setting`, {
    method: 'GET'
  })
// 配置流程详情
export const _setSetting = (id, body) =>
  xhr(`./api/systemManagement/flow/${id}/setting`, {
    method: 'POST',
    body
  })
// 获取系统流程
export const _getflows = () =>
  xhr(`./api/systemManagement/flows`, {
    method: 'GET'
  })
// 获取所有检查项目
export const _getCheckProjectList = () =>
  xhr(`./api/checkProject/list`, {
    method: 'GET'
  })
// 获取检查明细
export const _getlistByProjectId = projectId =>
  xhr(`./api/checkProject/item/listByProjectId/${projectId}`, {
    method: 'GET'
  })
// 新增检查项目
export const _addCheckProject = body =>
  xhr(`./api/checkProject/add`, {
    method: 'POST',
    body
  })
// 添加检查项目明细
export const _addCheckProjectItem = body =>
  xhr(`./api/checkProject/item/add`, {
    method: 'POST',
    body
  })
// 删除检查项目
export const _delCheckProject = id =>
  xhr(`./api/checkProject/${id}`, {
    method: 'DELETE'
  })
// 删除检查项目明细
export const _delCheckProjectItem = id =>
  xhr(`./api/checkProject/item/${id}`, {
    method: 'DELETE'
  })
// 审批当前任务
export const commitApproval = (applyId, body) =>
  xhr(`./api/apply/commit/${applyId}`, {
    method: 'post',
    body
  })
// 修改 备案/分配 状态
export const updateFiling = (applyId, body) =>
  xhr(`./api/apply/${applyId}`, {
    method: 'PUT',
    body
  })
// 生成备案编号
export const getFilingNum = applyId =>
  xhr(`./api/apply/${applyId}/filingNumber`, {
    method: 'PUT'
  })
// 根据条件查询班级列表信息
export const getListClass = body =>
  xhr(`./api/common/listClassByQueryCondition`, {
    method: 'post',
    body
  })
// 检查项目-获取总分
export const _getTotalScore = () =>
  xhr(`./api/checkProject/countScore`, {
    method: 'GET'
  })
// 获取分配状态
export const _getFiling = applyId =>
  xhr(`./api/apply/${applyId}`, {
    method: 'GET'
  })
